]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Only create one strategy
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 26 Feb 2013 00:31:03 +0000 (19:31 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sat, 20 Apr 2013 12:33:26 +0000 (08:33 -0400)
Now that we don't have any other strategies but the unaligned
one, we only need to construct it once.

https://bugzilla.gnome.org/show_bug.cgi?id=694469

js/ui/workspace.js

index 67f3b939d70047873938c8c93f663314f752bd4e..6405050ce6b2741641dc05681ab7148362d97614 100644 (file)
@@ -1475,6 +1475,8 @@ const Workspace = new Lang.Class({
 
         let lastLayout = {};
 
+        let strategy = new UnalignedLayoutStrategy(this._monitor, rowSpacing, columnSpacing);
+
         for (let numRows = 1; ; numRows++) {
             let numColumns = Math.ceil(windows.length / numRows);
 
@@ -1484,8 +1486,6 @@ const Workspace = new Lang.Class({
             if (numColumns == lastLayout.numColumns)
                 break;
 
-            let strategy = new UnalignedLayoutStrategy(this._monitor, rowSpacing, columnSpacing);
-
             let layout = { area: area, strategy: strategy, numRows: numRows, numColumns: numColumns };
             strategy.computeLayout(windows, layout);
             strategy.computeScaleAndSpace(layout);